import request from '@/utils/request'

export function getList(params) {
    var fields = "{'jsContent':0}"
    var url = '/api/data/q?namespace=jsp_handle&fields=' + encodeURI(fields)
    return request({
        url: url,
        method: 'get',
        params
    })
}

export function save(data) {
    return request({
        url: '/api/data/save?namespace=jsp_handle',
        method: 'post',
        headers: {
            "Content-Type": "application/json;"
        },
        data
    })
}

export function get(id) {
    var url = '/api/data/q?namespace=jsp_handle&where=' + encodeURI("{'_id':" + id + "}")
    return request({
        url: url,
        method: 'get'
    })
}

export function del(id) {
    var url = '/api/data/del?namespace=jsp_handle&id=' + id
    return request({
        url: url,
        method: 'get'
    })
}
